package com.dgw.bootorderservice.controller;

import com.mall.bean.UserAddress;
import com.mall.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @program: boot-mall-interface
 * @description:
 * @author: Mr.Dai
 * @create: 2020-04-30 11:00
 **/
@Controller
public class OrderController {

    @Autowired
    private OrderService orderService;

    @ResponseBody
    @GetMapping("/initOrder")
    public List initOrder(@RequestParam("id")String id){
        List<UserAddress> addressList = orderService.initOrder(id);
        return addressList;
    }
}
